<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>

<html>
<head> 
	<title>Videshop POS</title> 
	<link href="../css/style.css" rel="stylesheet" type="text/css">
</head>
<body>
	<f:view>
		<table border="0" cellpadding="0" cellspacing="10">
			<tr>
				<td colspan="2"><h1>Videoshop POS</h1></td>
			</tr>
			<tr>
				<td valign="top">
					<table border="0" cellpadding="0" cellspacing="0">
						<tr>
							<td>
								<!-- User section -->
								<f:subview id="userSection">
									<jsp:include page="user.jsp"/>
								</f:subview>
							</td>
						</tr>
						<tr>
							<td>
								<!-- Menu section -->
								<f:subview id="menuSection">
									<jsp:include page="menu.jsp"/>
								</f:subview>
							</td>
						</tr>
					</table>
				</td>
				<td valign="top" class="mainSection">
					<c:choose>
						<c:when test="${!empty userSection.staff && userSection.staff.seniorManager}">
							<h2>Store</h2>
							<h:form>
								<h:panelGrid columns="4">
									<h:outputText styleClass="label" value="Store Id"/>
									<h:outputText styleClass="field" value="#{storeSection.selectedStore.storeId}"/>
									<h:outputText styleClass="label" value="Store Name"/>
									<h:inputText styleClass="text200" value="#{storeSection.selectedStore.storeName}"/>
								</h:panelGrid>
								<h:panelGrid columns="2">
									<h:outputText styleClass="label" value="Address"/>
									<h:inputText styleClass="text200" value="#{storeSection.selectedStore.address.addressLine}"/>
									<h:outputText styleClass="label" value="Suburb"/>
									<h:inputText styleClass="text100" value="#{storeSection.selectedStore.address.suburb}"/>
									<h:outputText styleClass="label" value="Postcode"/>
									<h:inputText styleClass="text50" value="#{storeSection.selectedStore.address.postcode}"/>
									<h:outputText styleClass="label" value="State"/>
									<h:selectOneListbox	styleClass="select100" value="#{storeSection.selectedStore.address.stateString}" size="1">
										<f:selectItems value="#{addressStateComponent.states}"/>
									</h:selectOneListbox>
								</h:panelGrid>
								<h:commandLink styleClass="button" action="#{storeSection.save}" value="Save"/>
							</h:form>
							<h:form>
								<h:commandLink styleClass="moreButton" action="browse" value="Back"/>
							</h:form>
						</c:when>
						<c:otherwise>
							Please login
						</c:otherwise>
					</c:choose>
				</td>
			</tr>
		</table>
	</f:view>
</html>